using System;
using System.Collections.Generic;
using System.ComponentModel;
using Iesi.Collections;
using Iesi.Collections.Generic;
using METODESA.Server.Data.Components;
using METODESA.Server.Data.Exceptions;
using METODESA.Server.Data.METODESA.Entity;

namespace METODESA.Server.Data.METODESA.Entity 
{    
	/// <summary>
	/// An object representation of the Servicio table
	/// </summary>
	[Serializable]
	public partial class Servicio
	{
		private System.Int32 _Id;

		private System.String _FechaFin;
		private System.String _FechaInicio;
		private OrdenVenta _OrdenVenta ;
        private Nullable<System.Double> _Precio;
        private System.Int32 _Borrable;
        private System.String _Descripcion;
		private System.String _Tipo;


	    public virtual System.String FechaFin
		{
			get
			{
				return _FechaFin;
			}
			set
			{
				_FechaFin = value;
			}
		}

		public virtual System.String FechaInicio
		{
			get
			{
				return _FechaInicio;
			}
			set
			{
				_FechaInicio = value;
			}
		}
        public virtual System.String Descripcion
        {
            get
            {
                return _Descripcion;
            }
            set
            {
                _Descripcion = value;
            }
        }

		public virtual OrdenVenta OrdenVenta
		{
			get
			{
				return _OrdenVenta;
			}
            set
            {
                _OrdenVenta = value;
            }
		}

		public virtual System.Int32 Id
		{
			get
			{
				return _Id;
			}
			set
			{
				_Id = value;
			}
		}

        public virtual Nullable<System.Double> Precio
		{
			get
			{
				return _Precio;
			}
			set
			{
				_Precio = value;
			}
		}
        public virtual System.Int32 Borrable
        {
            get
            {
                return _Borrable;
            }
            set
            {
                _Borrable = value;
            }
        }

		public virtual System.String Tipo
		{
			get
			{
				return _Tipo;
			}
			set
			{
				if (value == null)
				{
					throw new BusinessException("TipoRequired", "Tipo must not be null.");
				}
				_Tipo = value;
			}
		}


		protected bool Equals(Servicio entity)
		{
			if (entity == null) return false;
			if (!base.Equals(entity)) return false;
			if (!Equals(_Id, entity._Id)) return false;
			return true;
		}

		public override bool Equals(object obj)
		{
			if (ReferenceEquals(this, obj)) return true;
			return Equals(obj as Servicio);
		}

		public override int GetHashCode()
		{
			int result = base.GetHashCode();
			result = 29*result + _Id.GetHashCode();
			return result;
		}

	}
}
